//
//  MainViewController.m
//  網易
//
//  Created by 赵天宇 on 16/8/22.
//  Copyright © 2016年 赵天宇. All rights reserved.
//

#import "MainViewController.h"
#import "NewViewController.h"
#import "ZhiViewController.h"
#import "HuaTiViewController.h"
#import "MeViewController.h"
#import "AppDelegate.h"
@interface MainViewController (){
}

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UINavigationController *n1=[[UINavigationController alloc]initWithRootViewController:[[NewViewController alloc]init]];
    UINavigationController *n2=[[UINavigationController alloc]initWithRootViewController:[[ZhiViewController alloc]init]];
    UINavigationController *n3=[[UINavigationController alloc]initWithRootViewController:[[HuaTiViewController alloc]init]];
    UINavigationController *n4=[[UINavigationController alloc]initWithRootViewController:[[MeViewController alloc]init]];
    n1.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"新闻"image:[UIImage imageNamed:@"night_tabbar_icon_news_normal@2x.png"] tag:1];
    n2.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"直播"image:[UIImage imageNamed:@"night_tabbar_icon_media_normal@2x.png"] tag:2];
    n3.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"话题"image:[UIImage imageNamed:@"night_tabbar_icon_bar_normal@2x.png"] tag:3];
    n4.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"我"image:[UIImage imageNamed:@"night_tabbar_icon_me_normal@2x.png"] tag:4];
    self.viewControllers=@[n1,n2,n3,n4];
    self.tabBar.tintColor=[UIColor redColor];
    [self setSelectedIndex:0];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(change:) name:@"ss" object:nil];
       // Do any additional setup after loading the view.
}
-(void)change:(NSNotification *)noT{
    [self setSelectedIndex:1];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be rec reated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
